'\" te
.\" Copyright (c) 2013 Gary Mills
.\" Copyright (c) 2001 Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 1989 AT&T
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH WHODO 8 "Feb 17, 2023"
.SH NAME
whodo \- who is doing what
.SH SYNOPSIS
.nf
\fB/usr/sbin/whodo\fR [\fB-h\fR] [\fB-l\fR] [\fIuser\fR]
.fi

.SH DESCRIPTION
The \fBwhodo\fR command produces formatted and dated output from information in
the \fB/var/adm/utmpx\fR and \fB/proc/pid\fR files.
.sp
.LP
The display is headed by the date, time, and machine name. For each user logged
in, device name, user-ID and login time is shown, followed by a list of active
processes associated with the user-ID. The list includes the device name,
process-ID, CPU minutes and seconds used, and process name.
.sp
.LP
If \fIuser\fR is specified, output is restricted to all sessions pertaining to
that user.
.SH OPTIONS
The following options are supported:
.sp
.ne 2
.na
\fB\fB-h\fR\fR
.ad
.RS 6n
Suppress the heading.
.RE

.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 6n
Produce a long form of output. The fields displayed are: the user's login name,
the name of the tty the user is on, the time of day the user logged in
(in ISO time format, weekday name and \fIhours\fR\fB:\fR\fIminutes\fR,
or ISO date format),
the idle time \(em that is, the time since the user last typed anything
(in \fIhours\fR\fB:\fR\fIminutes\fR\fB:\fR\fIseconds\fR),
the CPU time used by all processes and their children on that terminal
(in \fIhours\fR\fB:\fR\fIminutes\fR\fB:\fR\fIseconds\fR),
the CPU time used by the currently active processes
(in \fIhours\fR\fB:\fR\fIminutes\fR\fB:\fR\fIseconds\fR),
and the name and arguments of the current process.
.RE

.SH EXAMPLES
\fBExample 1 \fRUsing the whodo Command
.sp
.LP
The command:

.sp
.in +2
.nf
example% whodo
.fi
.in -2
.sp

.sp
.LP
produces a display like this:

.sp
.in +2
.nf
Tue Mar 12 15:48:03 1985
bailey
tty09    mcn       8:51
    tty09   28158    0:29 sh

tty52    bdr      15:23
    tty52   21688    0:05 sh
    tty52   22788    0:01 whodo
    tty52   22017    0:03 vi
    tty52   22549    0:01 sh

xt162    lee      10:20
    tty08    6748    0:01 layers
    xt162    6751    0:01 sh
    xt163    6761    0:05 sh
    tty08    6536    0:05 sh
.fi
.in -2
.sp

.SH ENVIRONMENT VARIABLES
If any of the \fBLC_*\fR variables (\fBLC_CTYPE\fR,
\fBLC_MESSAGES\fR, \fBLC_TIME\fR, \fBLC_COLLATE\fR,
\fBLC_NUMERIC\fR, and \fBLC_MONETARY\fR) (see \fBenviron\fR(7)) are not
set in the environment, the operational behavior of \fBtar\fR(1) for each
corresponding locale category is determined by the value of the \fBLANG\fR
environment variable. If \fBLC_ALL\fR is set, its contents are used to override
both the \fBLANG\fR and the other \fBLC_*\fR variables. If none of the above
variables is set in the environment, the "C" (U.S. style) locale determines how
\fBwhodo\fR behaves.
.sp
.ne 2
.na
\fB\fBLC_CTYPE\fR\fR
.ad
.RS 15n
Determines how \fBwhodo\fR handles characters. When \fBLC_CTYPE\fR is set to a
valid value, \fBwhodo\fR can display and handle text and filenames containing
valid characters for that locale. The \fBwhodo\fR command can display and
handle Extended Unix code (EUC) characters where any individual character can
be 1, 2, or 3 bytes wide. \fBwhodo\fR can also handle EUC characters of 1, 2,
or more column widths. In the "C" locale, only characters from ISO 8859-1 are
valid.
.RE

.sp
.ne 2
.na
\fB\fBLC_MESSAGES\fR\fR
.ad
.RS 15n
Determines how diagnostic and informative messages are presented. This includes
the language and style of the messages, and the correct form of affirmative and
negative responses. In the "C" locale, the messages are presented in the
default form found in the program itself (in most cases, U.S. English).
.RE

.sp
.ne 2
.na
\fB\fBLC_TIME\fR\fR
.ad
.RS 15n
Determines how \fBwhodo\fR handles date and time formats. In the "C" locale,
date and time handling follow the U.S. rules.
.RE

.SH EXIT STATUS
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 12n
Successful completion.
.RE

.sp
.ne 2
.na
\fBnon-zero\fR
.ad
.RS 12n
An error occurred.
.RE

.SH FILES
.ne 2
.na
\fB\fB/etc/passwd\fR\fR
.ad
.RS 18n
System password file
.RE

.sp
.ne 2
.na
\fB\fB/var/adm/utmpx\fR\fR
.ad
.RS 18n
User access and administration information
.RE

.sp
.ne 2
.na
\fB\fB/proc/pid\fR\fR
.ad
.RS 18n
Contains PID
.RE

.SH SEE ALSO
.BR ps (1),
.BR who (1),
.BR attributes (7),
.BR environ (7)
